package bairui.international.console.web.controller.advance.category.product;

import com.lianjing.sh.spring.web.controller.enhance.module.Module;
import com.lianjing.sh.spring.web.controller.enhance.module.ModuleHead;
import com.lianjing.sh.spring.web.controller.enhance.module.body.AddModuleBody;

/**
 *
 * Module_Add
 *
 */
class Module_Add{


	public Module module(
		bairui.international.model.domain.jpa.TB_Product bean
		,
		C_Advance_Category_ProductAdd_Add.Add.Operate c_Advance_Category_ProductAdd_Add_Add_Operate

		,com.lianjing.sh.spring.web.controller.enhance.input.InputModelContextMethodInfoEditor ... editors

	){
		return this.moduleTemplate(
				bean
				,
				c_Advance_Category_ProductAdd_Add_Add_Operate

				,editors
			);
	}

	public Module module(
		java.util.List<bairui.international.model.domain.jpa.TB_Product> bean
		,
		C_Advance_Category_ProductAdd_Add.Add.Operate c_Advance_Category_ProductAdd_Add_Add_Operate

		,com.lianjing.sh.spring.web.controller.enhance.input.InputModelContextMethodInfoEditor ... editors

	){
		return this.moduleTemplate(
				bean
				,
				c_Advance_Category_ProductAdd_Add_Add_Operate

				,editors
			);
	}

	public Module module(
	//	,
	C_Advance_Category_ProductAdd_Add.Add.Operate c_Advance_Category_ProductAdd_Add_Add_Operate

	,com.lianjing.sh.spring.web.controller.enhance.input.InputModelContextMethodInfoEditor ... editors

	){
		Object bean = null;
		return this.moduleTemplate(
				bean
				,
				c_Advance_Category_ProductAdd_Add_Add_Operate

				,editors
			);
	}

	/**
	 * 编辑模块
	 */
	private Module moduleTemplate(
		Object bean
		,
		C_Advance_Category_ProductAdd_Add.Add.Operate c_Advance_Category_ProductAdd_Add_Add_Operate

		,com.lianjing.sh.spring.web.controller.enhance.input.InputModelContextMethodInfoEditor ... editors

	){
		return
			new Module(
					new ModuleHead("添加")
					,
					new AddModuleBody(
							bean,
							Model.class,
							c_Advance_Category_ProductAdd_Add_Add_Operate,
							Relation.relations(
								)
							,editors
						)
				);
	}

	/**
	 * 输入模型
	 */
	static public class Models {
		private @lombok.Getter @lombok.Setter java.util.List<Model> models = new java.util.ArrayList<>();
	}

	@org.springframework.stereotype.Component("bairui.international.console.web.controller.advance.category.product.Module_Add$Model")

	static public class Model

	 extends bairui.international.model.domain.jpa.TB_Product

	 implements

		com.lianjing.sh.spring.web.controller.enhance.input.InputModelable

	{



		/**

		 * 默认构造函数

		 */

		public Model(){}



		/**

		 * 构造函数

		 */

		public Model(

			bairui.international.model.domain.jpa.TB_Product bean

		){

			if(null != bean){

				this.setNumber(bean.getNumber());

				this.setName(bean.getName());

				this.setPrice(bean.getPrice());

				this.setShowPrice(bean.getShowPrice());

				this.setExchange(bean.getExchange());

				this.setDivideRate(bean.getDivideRate());

				this.setOrderValue(bean.getOrderValue());

				this.setComment(bean.getComment());

				this.setImgUrl(bean.getImgUrl());

			}

		}





		@com.lianjing.sh.model.common.annotation.Comment("代码")

		@com.sh_lianjing.reflect.method.annotation.MethodOrder(1001)

		@org.hibernate.validator.constraints.NotBlank

		@javax.validation.constraints.Size(min=0, max=32)

		@com.lianjing.sh.validate.data.Unique(domainType=bairui.international.model.domain.jpa.TB_Product.class)

		@Override

		public String getNumber() {

			return (String)super.getNumber();

		}





		@com.lianjing.sh.model.common.annotation.Comment("名称")

		@com.sh_lianjing.reflect.method.annotation.MethodOrder(2001)

		@org.hibernate.validator.constraints.NotBlank

		@javax.validation.constraints.Size(min=0, max=255)

		@Override

		public String getName() {

			return (String)super.getName();

		}





		@com.lianjing.sh.model.common.annotation.Comment("预售价")

		@com.sh_lianjing.reflect.method.annotation.MethodOrder(3001)

		@javax.validation.constraints.NotNull

		@javax.validation.constraints.Max(Long.MAX_VALUE)

		@javax.validation.constraints.Min(0)

		@Override

		public Double getPrice() {

			return (Double)super.getPrice();

		}





		@com.lianjing.sh.model.common.annotation.Comment("尊享价")

		@com.sh_lianjing.reflect.method.annotation.MethodOrder(4001)

		@javax.validation.constraints.NotNull

		@javax.validation.constraints.Max(Long.MAX_VALUE)

		@javax.validation.constraints.Min(0)

		@Override

		public Double getShowPrice() {

			return (Double)super.getShowPrice();

		}





		@com.lianjing.sh.model.common.annotation.Comment("兑换积分值")

		@com.sh_lianjing.reflect.method.annotation.MethodOrder(5001)

		@javax.validation.constraints.NotNull

		@javax.validation.constraints.Max(Long.MAX_VALUE)

		@javax.validation.constraints.Min(0)

		@Override

		public Double getExchange() {

			return (Double)super.getExchange();

		}





		@com.lianjing.sh.model.common.annotation.Comment("分成比率[%]")

		@com.sh_lianjing.reflect.method.annotation.MethodOrder(6001)

		@javax.validation.constraints.NotNull

		@javax.validation.constraints.Max(100)

		@javax.validation.constraints.Min(0)

		@Override

		public Double getDivideRate() {

			return (Double)super.getDivideRate();

		}





		@com.lianjing.sh.model.common.annotation.Comment("排序")

		@com.sh_lianjing.reflect.method.annotation.MethodOrder(7001)

		@javax.validation.constraints.NotNull

		@javax.validation.constraints.Max(Integer.MAX_VALUE)

		@javax.validation.constraints.Min(Integer.MIN_VALUE)

		@com.lianjing.sh.spring.web.controller.enhance.input.annotation.DefaultValue("0")

		@Override

		public Integer getOrderValue() {

			return (Integer)super.getOrderValue();

		}





		@com.lianjing.sh.model.common.annotation.Comment("产品描述")

		@com.sh_lianjing.reflect.method.annotation.MethodOrder(8001)

		@javax.validation.constraints.Size(min=0, max=500)

		@Override

		public String getComment() {

			return (String)super.getComment();

		}







		/**

		 * 文件属性

		 */

		private org.springframework.web.multipart.MultipartFile imgUrlFile;



		/**

		 * 文件方法

		 */

		@com.sh_lianjing.reflect.method.annotation.MethodOrder(9001)

		@com.lianjing.sh.model.common.annotation.Comment("图片")



		@com.lianjing.sh.validate.file.FileNotEmpty

		@com.lianjing.sh.validate.file.FileType(extension={"bmp","png","jpg","jpeg"})

		@com.lianjing.sh.validate.file.Image

		public org.springframework.web.multipart.MultipartFile getImgUrlFile() {

			return this.imgUrlFile;

		}

		public void setImgUrlFile(org.springframework.web.multipart.MultipartFile imgUrlFile) {

			this.imgUrlFile = imgUrlFile;

		}



		/**

		 * 非继承属性

		 */



		/**

		 * 得到输入属性

		 */

		/** 得到代码 */

		public String gainNumber() {

			return this.getNumber();

		}

		/** 得到名称 */

		public String gainName() {

			return this.getName();

		}

		/** 得到预售价 */

		public Double gainPrice() {

			return this.getPrice();

		}

		/** 得到尊享价 */

		public Double gainShowPrice() {

			return this.getShowPrice();

		}

		/** 得到兑换积分值 */

		public Double gainExchange() {

			return this.getExchange();

		}

		/** 得到分成比率[%] */

		public Double gainDivideRate() {

			return this.getDivideRate();

		}

		/** 得到排序 */

		public Integer gainOrderValue() {

			return this.getOrderValue();

		}

		/** 得到产品描述 */

		public String gainComment() {

			return this.getComment();

		}

		/** 得到 */

		public org.springframework.web.multipart.MultipartFile gainImgUrlFile() {

			return this.getImgUrlFile();

		}



		/**

		 * 转换到表单数据格式

		 */

		public java.util.Map<String, String> toFormData() throws com.sh_lianjing.serialize.json.jackson.exception.JsonException{

			return com.lianjing.sh.web.common.util.Util_Form.beanToFormDataFormat(this);

		}



	}



	static public class Relation
	{
		public static java.util.Map<String, java.util.List<?>> relations(
		){
			java.util.Map<String, java.util.List<?>> map = new java.util.HashMap<>();
			return map;
		}
	}



	/**
	 * 输出模型
	 */


}
